package cn.kzgg.ymcc.feign.login;

import cn.kzgg.ymcc.domain.Login;
import cn.kzgg.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class LoginFeignClientFallbackFactory implements FallbackFactory<LoginFeignClient> {
    @Override
    public LoginFeignClient create(Throwable throwable) {
        return new LoginFeignClient() {
            @Override
            public JSONResult saveOrUpdate(Login login) {
                throwable.printStackTrace();
                return JSONResult.error("认证服务不可达") ;
            }
        };
    }
}
